<template>
  <el-row :gutter="24">
    <el-col :span="4" style="height: 100vh">
      <el-input placeholder="输入关键字进行过滤" v-model="filterText">
      </el-input>

      <el-tree
        class="filter-tree"
        :data="treeData"
        :props="treeProps"
        default-expand-all
        :filter-node-method="filterNode"
        ref="tree"
        @node-click="handleNodeClick"
      >
      </el-tree>
      <div class="grid-content ep-bg-purple" />
    </el-col>
    
    <el-col :span="20" :offset="0" style="weight: 100vh">
      <schoolXx :treeDatas="treeDatas"  :treeId="treeId" v-if="BjXy=='xx_xx'"></schoolXx>
      <schoolZy :treeDatas="treeDatas"  :treeId="treeId" v-if="BjXy=='xx_zy'"></schoolZy>
      <schoolBj :treeDatas="treeDatas"  :treeId="treeId" v-if="BjXy=='xx_bj'"></schoolBj>
      <schoolXy :treeDatas="treeDatas"  :treeId="treeId" v-if="BjXy=='xx_xy'"></schoolXy>
    </el-col>
  </el-row>

  <!-- 表单 -->
</template>
  <script >
import {
  listXXTree,
  listComont,
  getComont,
  delComont,
  addComont,
  updateComont,
} from "../../api/sys/comont";
import { listXy, getXy, delXy, addXy, updateXy } from "../../api/sc/zy";
import  schoolZy  from "./schoolZy";
import  schoolXy  from "./schoolXy";
import  schoolBj  from "./schoolBj";
import  schoolXx  from "./schoolXx";
export default {
  components: { schoolZy ,schoolBj,schoolXy,schoolXx},
  name: "orderList",
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    },
    
  },

  methods: {
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
  },
  data() {
    
    return {
      BjXy:'xx_xx',
      treeData: [], // 组织树数据
      treeProps: {
        // 组织树获取数据规则
        children: "children",
        label: "sysComontName",
        id: "sysComontId",
      },
      defaultExpandArr: [0], // 组织树默认展开数据
      treeDatas:[],
      treeId:1
    };
  },
  created() {
    this.getTree();
  
  },
  methods: {

    getTree() {
      listXXTree().then((response) => {
        this.treeData = response.rows;
      });
    },

    /** 查询【请填写功能名称】列表 */

  

   
    
   
   
    handleNodeClick(data) {
        this.treeDatas = data
        this.queryParams={}
        //this.queryParams.scXyComid=data.sysComontId
        this.treeId = data.sysComontId
        this.treeDatas = data
    
        this.BjXy = data.sysComontValue
        
        console.log(`this.treeId`,this.treeId );
      }
  }
};
</script>


<style scoped>
.el-button--text {
  margin-right: 15px;
}
.el-select {
  width: 300px;
}
.el-input {
  width: 200px;
}
.dialog-footer button:first-child {
  margin-right: 10px;
}

.common-dialog {
  display: flex;
  justify-content: center;
  align-items: Center;
  overflow: hidden;
}
</style>